#!/bin/sh

BASE_PATH=$(cd `dirname $0`; pwd)
SERVICE_NAME=basketball-all-api
MIN_RESOUCE=2048M
MAX_RESOUCE=2048M
APOLLO_URL="http://192.168.11.45:8080"
ENV=dev

mkdir /data0/log-data/${SERVICE_NAME} -p
touch /data0/log-data/${SERVICE_NAME}/app.log

echo "正在启动：${SERVICE_NAME}"
nohup java -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -Xdebug \
        -Xms${MIN_RESOUCE} -Xmx${MAX_RESOUCE} -XX:CompressedClassSpaceSize=128m \
        -XX:MetaspaceSize=200m -XX:MaxMetaspaceSize=200m -Denv=dev -Dapp.id=${SERVICE_NAME} -D${ENV}_meta=${APOLLO_URL} \
        -Dspring.application.name=${SERVICE_NAME} -Dspring.profiles.active=${ENV} -Djava.security.egd=file:/dev/./urandom \
        -Dfile.encoding=utf-8 -XX:-OmitStackTraceInFastThrow -jar ${BASE_PATH}/$SERVICE_NAME-exec.jar 1>&-2> error.log &
echo "启动完成，请检查日志"

tail -f /data0/log-data/basketball-all-api/app.log